{% load i18n %}
<div class="btn-group export">
  <a class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown" href="#">
    <i class="fa fa-download"></i> 下载模板 <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
      <li><a href="{% url 'xadmin:downloadStudent' %}?q=学生信息表" class="download" data-toggle="modal"><i class="fa fa-download"></i> 下载学生信息模板</a></li>
      <li><a href="{% url 'xadmin:downloadStudent' %}?q=老师信息表" class="download" data-toggle="modal"><i class="fa fa-download"></i> 下载老师信息模板</a></li>
  </ul>
</div>
{##}
{#<div id="export-modal-import-excel" class="modal fade">#}
{#      <div class="modal-dialog">#}
{#        <div class="modal-content">#}
{#            <form method="post" action="" enctype="multipart/form-data">#}
{#              {% csrf_token %}#}
{#                  <div class="modal-header">#}
{#                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>#}
{#                    <h4 class="modal-title">导入 Excel </h4>#}
{#                  </div>#}
{#                  <div class="modal-body">#}
{#                       <input type="file" name="excel" accept=".xls, .xlsx" id="submit_upload">#}
{#                  </div>#}
{#                  <div class="modal-footer">#}
{#                    <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>#}
{#                    <button class="btn btn-success" type="submit" id="submit_upload_b"><i class="icon-share"></i> 导入</button>#}
{#                  </div>#}
{#            </form>#}
{#        </div>#}
{#      </div>#}
{#</div>#}
<script>
    $('.downoad').click(function () {
        var file = $('#submit_upload').val();
        if(file != ''){
            var theForm = $("form:first").get(0);
            theForm.submit()
        }else {
            alert('请选择文件!')
        }
    })
</script>